home *** CD-ROM | disk | FTP | other *** search
/ Laboratorio Interattivo Deagostini / laboratorio interattivo deagostini.bin / swf / 415.swf / scripts / frame_1 / PlaceObject2_4_3 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2003-01-07  |  2KB  |  83 lines

  1. onClipEvent(enterFrame){
  2.    function verifica()
  3.    {
  4.       var i = 0;
  5.       var giusto = 0;
  6.       i = 0;
  7.       while(i < lista.length)
  8.       {
  9.          clipBase = lista[i][2];
  10.          var testoInserito = _root[clipBase].lettera;
  11.          var l = 1;
  12.          daScrivere = lista[i][0];
  13.          l = 1;
  14.          while(l < daScrivere.length)
  15.          {
  16.             nomeCLip = clipBase + l;
  17.             testoInserito += _root[nomeCLip].lettera;
  18.             l++;
  19.          }
  20.          if(testoInserito.toLowerCase() == lista[i][0].toLowerCase())
  21.          {
  22.             giusto += 1;
  23.          }
  24.          i++;
  25.       }
  26.       if(giusto == lista.length)
  27.       {
  28.          _root.conferma._x = 2000;
  29.          getUrl("Finito:Giusto", "");
  30.       }
  31.       else
  32.       {
  33.          getUrl("Finito:Sbagliato", "");
  34.       }
  35.       _root.AvviaVerifica = 0;
  36.    }
  37.    function cliprilasciata(cheistanza)
  38.    {
  39.       var problema = 0;
  40.       var i = 0;
  41.       i = 0;
  42.       while(i < lista.length)
  43.       {
  44.          if(lista[i][2].toLowerCase() == cheistanza.substring(0,5).toLowerCase())
  45.          {
  46.             problema = 1;
  47.             var trovato = 0;
  48.             var e = 0;
  49.             e = 0;
  50.             while(e < lista[i][5].length)
  51.             {
  52.                if(lista[i][5][e] != cheistanza)
  53.                {
  54.                   daIntercettare = "_root." + lista[i][5][e];
  55.                   if(eval(daIntercettare).hitTest(_root._xmouse,_root._ymouse,true))
  56.                   {
  57.                      trovato = 1;
  58.                      _root[cheistanza]._x = _root[cheistanza].xorig;
  59.                      _root[cheistanza]._y = _root[cheistanza].yorig;
  60.                      var mossa = _root[cheistanza].lettera;
  61.                      var desti = eval(daIntercettare).lettera;
  62.                      eval(daIntercettare).lettera = mossa;
  63.                      _root[cheistanza].lettera = desti;
  64.                      break;
  65.                   }
  66.                }
  67.                e++;
  68.             }
  69.             if(trovato == 0 || problema == 0)
  70.             {
  71.                _root[cheistanza]._x = _root[cheistanza].xorig;
  72.                _root[cheistanza]._y = _root[cheistanza].yorig;
  73.             }
  74.          }
  75.          i++;
  76.       }
  77.    }
  78.    if(_root.AvviaVerifica == "1")
  79.    {
  80.       Verifica();
  81.    }
  82. }
  83.